<?php
include("./API.php");
tongji("qfgg");
$id=$_REQUEST["id"];//1为写 2为读
$key=$_REQUEST["key"];//秘钥
$msg=$_REQUEST["msg"];//内容
if($id=="1")
{
echo "修改成功";
$myfile = fopen("data/qfgg/$key.json", "w");
$xgt = "".$msg."";
fwrite($myfile, $xgt);
fclose($myfile);
}
else
if($id=="2")
$myfile = fopen("data/qfgg/$key.json", "r") or die("空空如也");
echo fread($myfile,filesize("data/qfgg/$key.json"));
fclose($myfile);
?>